<template>
    <div class="newsCommentListAdd">
        
        <el-form 
            ref="ruleForm" 
            label-width="100px"
            :rules="rules">
            <el-form-item label="评论内容" prop="content">
                <el-input v-model="contentText" placeholder="请输入评论内容" type="textarea"></el-input>
            </el-form-item>
        </el-form>
       <el-button @click="submitForm('ruleForm')" size="medium" class="addSubimit">提交</el-button>
    </div>
</template>
<script>
import { AddData,getChannel } from '@/assets/js'
export default {
    data(){
        return {
            contentText:this.content,
            rules:{//验证
                content:[
                    { required: true, message: '请输入评论内容', trigger: 'blur' }
                ]
            }
        }
    },
    methods:{
        submitForm:function(e){//点击提交
            var data = {
                appid:this.appid,
                content:this.content
            }
            console.log(data)
            AddData(this,e,data,'comment/editComment')
            
        }
    },
    props:['content','appid']
}
</script>
<style>
    .newsCommentListAdd .el-upload__tip{
        width: 300px;
    }
    .addSubimit{
        margin: 30px auto;
        text-align: center;
    }
</style>
